package com.lechuang.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lechuang.system.entity.RegionDictionary;
import com.lechuang.system.service.RegionDictionaryService;
import com.lechuang.system.mapper.RegionDictionaryMapper;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Objects;

/**
* @author apple
* @description 针对表【region_dictionary(省市区基础表)】的数据库操作Service实现
* @createDate 2024-06-24 13:58:44
*/
@Service
public class RegionDictionaryServiceImpl extends ServiceImpl<RegionDictionaryMapper, RegionDictionary>
    implements RegionDictionaryService{

    @Override
    public List<RegionDictionary> getTree(Long id) {
        LambdaQueryWrapper<RegionDictionary> queryWrapper =new LambdaQueryWrapper<>();
        queryWrapper.eq(Objects.nonNull(id), RegionDictionary::getId, id);
        return this.list(queryWrapper);
    }
}




